<?
global $skinsdir;
global $_skin;

$title = $_skin["title"]; #if (!$title) $title = "Sign In";

$trail = "";
if ($_skin["trail"]) {
foreach ($_skin["trail"] as $te) {
	list($uri,$title) = array($te["uri"],$te["title"]); 
	
	if ($uri != "" && $title != "")
		$trail.= "<a href='$uri'>$title</a> &gt; "; 
	elseif ($title != "") 
		$trail.= "$title &gt; ";
	}
}

ob_start();
include dirname(__FILE__)."/default.css";
$css = ob_get_contents();
ob_end_clean();

ob_start();
include "$skinsdir/main/index.php";
$content = ob_get_contents();
ob_end_clean();
$content = str_replace("%%","
<style type='text/css'>
$css
</style>
<table ><tr><td>
<h1>$trail</h1>
%%</table>
",$content);

$content = str_replace("src=\"","src=\"../main/",$content);

echo $content;